package com.daumcorp.searchdata.web;

import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.daumcorp.searchdata.bookstore.BookStoreService;

@Controller
@RequestMapping("/book")
public class BookController {
	@Autowired
	private BookStoreService bookStore;

	@RequestMapping(method = RequestMethod.GET)
	public String book(@RequestParam String isbn, ModelMap model) {
		ArrayList<String> s = new ArrayList<String>();
		for (int i = 0; i < 10; i++) {
			s.add("e");
		}

		model.addAttribute("book", bookStore.findBook(isbn));
		model.addAttribute("test", s);
		return "book";
	}
}